package com.demo.exception;

import com.demo.enums.ResponseStatus;

/**
 * 基础的异常信息
 * 
 *
 */
public class BaseException extends RuntimeException {

    private static final long serialVersionUID = -7215389847384607920L;
    
    protected  ResponseStatus status;

    public BaseException(String message) {
        super(message);
    }

    public BaseException(ResponseStatus status) {
        this(status.getMessage());
        this.status=status;
    }

    public ResponseStatus getStatus() {
        return status==null?ResponseStatus.ERROR:status;
    }

    
}
